CREATE TABLE sent_tmp (val array<string>);
CREATE TABLE sent_tmp2 (val string);
INSERT OVERWRITE TABLE sent_tmp
SELECT explode(sentences(decode(unhex("486976652065737420756E20657863656C6C656E74206F7574696C20706F7572206C65732072657175C3AA74657320646520646F6E6EC3A965732C20657420706575742DC3AA74726520706C757320706F6C7976616C656E7420717565206C612074726164756374696F6E206175746F6D61746971756521206C6120706F6E6374756174696F6E206D756C7469706C65732C206465732070687261736573206D616C20666F726DC3A96573202E2E2E20636F6E667573696F6E202D20657420706F757274616E742063652055444620666F6E6374696F6E6E6520656E636F72652121"), "UTF-8"), "fr")) AS val FROM src LIMIT 3;
INSERT OVERWRITE TABLE sent_tmp2
SELECT explode(val) AS val FROM sent_tmp;
SELECT hex(val) AS value FROM sent_tmp2 ORDER BY value ASC;

DROP TABLE sent_tmp;
DROP TABLE sent_tmp2;

CREATE TABLE sent_tmp (val array<string>);
CREATE TABLE sent_tmp2 (val string);
INSERT OVERWRITE TABLE sent_tmp
SELECT explode(sentences(decode(unhex("48697665206973742065696E2061757367657A656963686E65746573205765726B7A6575672066C3BC7220646965204162667261676520766F6E20446174656E2C20756E64207669656C6C6569636874207669656C736569746967657220616C7320646965206D61736368696E656C6C6520C39C6265727365747A756E6721204D756C7469706C652C207363686C6563687420676562696C646574656E2053C3A4747A65202E2E2E205665727765636873656C756E6720496E74657270756E6B74696F6E202D20756E6420646F636820697374206469657365205544462066756E6B74696F6E6965727420696D6D6572206E6F63682121"), "UTF-8"), "de")) AS val FROM src LIMIT 3;
INSERT OVERWRITE TABLE sent_tmp2
SELECT explode(val) AS val FROM sent_tmp;
SELECT hex(val) AS value FROM sent_tmp2 ORDER BY value ASC;



SELECT sentences("Hive is an excellent tool for data querying\; and perhaps more versatile than machine translation!! Multiple, ill-formed sentences...confounding punctuation--and yet this UDF still works!!!!") AS value FROM src ORDER BY value ASC LIMIT 1;
